<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/


$router->get('/', function () use ($router) {
    return '的装1.0';
});


//staff接口
$router->group(['namespace' => 'Staff'], function () use ($router) {
    $router->post('/regist', 'RegisterController@regist');//注册
    $router->post('/login', 'RegisterController@login');//登陆
    $router->post('/sendsms', 'RegisterController@sendSms');//发送短信
//    $router->post('/check_sms', 'RegisterController@checkSms');//发送短信
    $router->post('/forget_password', 'RegisterController@forgetPassword');//忘记密码
    $router->post('/change_password', 'RegisterController@changePassword');//修改密码
    $router->get('/userinfo', 'RegisterController@userInfo');//获取用户信息


    $router->post('/attestation', 'StaffController@attestation');//认证
    $router->get('/information', 'StaffController@information');//消息中心
    $router->get('/rush_order', 'StaffController@rushOrderList');//获取服务
    $router->post('/rush', 'StaffController@rushOrder');//抢单
    $router->get('/service_list', 'StaffController@serviceList');//服务订单列表
    $router->get('/order_list', 'StaffController@orderList');//所有订单列表
    $router->post('/time_log', 'StaffController@timeLog');//服务时间
    $router->get('/online', 'StaffController@online');//在线时间，周，月 累计

    $router->get('versions', 'StaffController@versions'); //版本更新

});

//小程序登陆
$router->group(['prefix' => 'api', 'namespace' => 'Api'], function () use ($router) {
    $router->post('/login', 'UserController@login');//登陆

});
//小程序接口
$router->group(['namespace' => 'Api','middleware' => 'auth'], function () use ($router) {
//    $router->post('api/login', 'UserController@login');//添加
    $router->get('api/home', 'ServiceController@index');
    $router->get('api/goods_class', 'ServiceController@goodsClass');//获取服务

    $router->post('api/create_order', 'ServiceController@createOrder');//提交订单
    $router->post('api/cancel_order', 'ServiceController@cancelOrder');//取消订单
    $router->post('api/confirm_order', 'ServiceController@confirmOrder');//确认订单
    $router->get('api/order_list', 'ServiceController@orderList');//订单列表
    $router->post('api/change_staff', 'ServiceController@changeStaff');//更换师傅

    $router->get('api/order_heartbeat', 'ServiceController@orderHeartbeat');//心跳

//    $router->post('/upload', 'UploadController@upload');//图片上传
});

$router->group(['namespace' => 'Api'], function () use ($router) {
    $router->post('/upload', 'UploadController@upload');//图片上传
});






